package cn.yq.aio.ui.main.xueyang.sdk;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.Handler;
import android.os.IBinder;
import android.util.Log;

public class BLEManager {

    private static final long SCAN_PERIOD = 15000;
    public static final String ACTION_FIND_DEVICE = "find_device";
    public static final String ACTION_SEARCH_TIME_OUT = "search_timeout";
    public static final String ACTION_START_SCAN = "start_scan";

    /**
     * 自定义过滤器
     * custom intentFilter
     */
    public static IntentFilter makeGattUpdateIntentFilter() {
        final IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(BluetoothLeService.ACTION_GATT_CONNECTED);
        intentFilter.addAction(BluetoothLeService.ACTION_GATT_DISCONNECTED);
        intentFilter.addAction(BluetoothLeService.ACTION_GATT_SERVICES_DISCOVERED);
        intentFilter.addAction(BluetoothLeService.ACTION_DATA_AVAILABLE);
        //---
        intentFilter.addAction(BluetoothLeService.ACTION_SPO2_DATA_AVAILABLE);
        intentFilter.addAction(BluetoothLeService.ACTION_CHARACTER_NOTIFICATION);
        intentFilter.addAction(ACTION_FIND_DEVICE);
        intentFilter.addAction(ACTION_SEARCH_TIME_OUT);
        intentFilter.addAction(ACTION_START_SCAN);
        return intentFilter;
    }

}
